﻿using ChatGPTIntegrationProject.ExternalAPI.Extensions.Handler;
using ChatGPTIntegrationProject.ExternalAPI.Interfaces.Api;

using Refit;

namespace ChatGPTIntegrationProject.ExternalAPI.Extensions
{
    /// <summary>
    /// Регистрация API REFIT
    /// </summary>
    public static class RefitServiceCollectionExtensions
    {
        public static void AddRefitClients(this IServiceCollection services)
        {
            services.AddRefitClient<IOpenRouterAIApi>()
                .ConfigureHttpClient(c =>
                {
                    c.BaseAddress = new Uri("https://openrouter.ai");
                });/*.ConfigurePrimaryHttpMessageHandler(() => new AuthenticatedHttpClientHandler(Properties.Resources.openrouterToken));*/ 

            ///по такому же принципу можно добавить и все остальные нужные апи
        }
    }
}